
/* 
Run the Trump vs GOP OLS regressions
*/

set more off

estimates clear
clear

use ".\Dropbox\Vaccination\covid.dta" // load the dataset

drop if statefips==48|statefips==15 // drop states without the vaccination data

zscore(rep*2016 diff* vacc*) // standardize the variables

label variable z_rep_pres2016 "Trump vote share, 2016"
label variable z_rep_house2016 "Republican House vote share, 2016"
label variable z_diff_trump_house"Trump-GOP gap, 2016"
label variable z_diff_house_trump "GOP-Trump gap, 2016"


local county "lat lon temp rain income native_share white_share col_share elder_share male_share  mfg_share_diff popden" // county characteristics


// Trump vs house: without county controls
reg z_vaccinated_18pluspop_ratio z_diff_trump_house z_rep_house2016  i.statefips, cluster(statefips) 
estimates store baseline_ols_geo

// Trump vs house: geo and socioeconomic controls 
reg z_vaccinated_18pluspop_ratio z_diff_trump_house z_rep_house2016 `county' i.statefips, cluster(statefips) 
estimates store baseline_ols_socio

// house vs Trump: without county controls
reg z_vaccinated_18pluspop_ratio z_diff_house_trump z_rep_pres2016  i.statefips, cluster(statefips) 
estimates store falsified_ols_geo

// Trump vs house: geo and socioeconomic controls 
reg z_vaccinated_18pluspop_ratio z_diff_house_trump z_rep_pres2016 `county' i.statefips, cluster(statefips) 
estimates store falsified_ols_socio

estout baseline* falsified* using ".\Dropbox\Vaccination\Draft\tab_baseline_ols.tex", replace style(tex) cells(b(fmt(3) star) se(par fmt(3))) stats(r2 N, fmt(2 0) labels("R-squared" "Observations")) keep(z_diff_trump_house z_rep_house2016 z_diff_house_trump z_rep_pres2016 ) label mlabels(none) collabels(none) starlevels(* 0.10 ** 0.05 *** 0.01)